#include <stdio.h>
#include <math.h>

double area(double x1, double y1);
double length(double x2, double y2);
double cal(double x3, double y3, double(*p)(double m, double n));

int main(void)
{
	double a, b, c, s;
	
	printf("Input two right-angle sides: ");
	scanf("%lf%lf", &a, &b);
	s = cal(a, b, area);
	c = cal(a, b, length);
	printf("s = %.2f\n", s);
	printf("c = %.2f\n", c);
	
	return 0;
}

double area(double x1, double y1)
{
	return x1 * y1 / 2;
}

double length(double x2, double y2)
{
	return sqrt(x2 * x2 + y2 * y2);
}

double cal(double x3, double y3, double(*p)(double m, double n))
{
	return (*p)(x3, y3);
}